# -*- coding: utf-8 -*-
# 姓名:谚语
# 开发时间:2022/11/8 19:46
from sqlalchemy import ForeignKey
from comment.modules import db


# 待匹配资金表的模型类
class Funding_not_matched(db.Model):
    __tablename__ = 't_funding_not_matched'
    fId = db.Column(db.BIGINT, primary_key=True, autoincrement=True, doc='主键')
    fInvestRecordId = db.Column(db.BIGINT, ForeignKey('t_invest_record.pId'), doc='投资记录')
    investRecord = db.relationship('Invest_record', backref=db.backref('fundsNotMatched', lazy=True))
    fNotMatchedMoney = db.Column(db.Float(8, 2), doc='待匹配金额')
    fFoundingType = db.Column(db.Integer, doc='资金类型', default=1)  # 存款类型 借款类型
    fFoundingWeight = db.Column(db.Float(8, 2), doc='资金【最终匹配的金额】')
    matchedStatus = db.Column(db.Integer, doc='匹配状态')  # 0 未匹配  1 部分匹配  2 完全匹配
    fCreateDate = db.Column(db.DateTime, doc='创建时间', default=0)
